<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<tiles:insertDefinition name="defaultTemplate">
	<tiles:putAttribute name="body">

	<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/appManagement.js"></script>
	<script type="text/javascript">$(document).ready(function() {dataTable('${oLanguage}','${pageContext.request.contextPath}'); alertMessage('${status}','${message}');});</script>

		<div class="body">
		

				<div class="panel-heading">
					<h4><span class="text-success">Application </span> <span style="color:#ccc; text-shadow:0 1px #fff"> Management</span></h4>

				</div>
				<div id="message"></div>
				<form:form method="POST" commandName="application" enctype="multipart/form-data">
				
				<form:errors path="*" cssClass="alert alert-danger" element="div" />

					<div class="row" style="margin-left: 28%;margin-top: 2%;">
						<div class="col-sm-2" style="margin-right: 1%;">
							<div class="row form-group">
							<label for="inputAppID"><spring:message code="field.Id" /></label>
								<input type="text" class="form-control input-sm" id="vaApplicationId" name="vaApplicationId"  data-required="true" placeholder="<spring:message code="field.Id" />"/>
								<input type="text" class="form-control input-sm" id="updateApplicationId" name="updateApplicationId" style="display: none;"  data-required="true" placeholder="<spring:message code="field.Id" />">
								<form:errors path="vaApplicationId" cssClass="error" />
							</div>
						</div>
						<div class="col-sm-5" style="width:362px; margin-right: 1%;">
							<div class="row form-group">
								<label for="inputAppName"><spring:message code="field.AppName" /></label>
								<input type="text" class="form-control input-sm" id="vaApplicationName" name="vaApplicationName" placeholder="<spring:message code="field.AppName" />">
							</div>
						</div>
					</div>
					
					<div class="row" style="margin-left: 28%;">	
						<div class="col-sm-7" style="width:512px;">
							<div class="row form-group">
								<label for="inputLink"><spring:message code="field.Link" /></label>
								<input type="text" class="form-control input-sm" id="vaLink" name="vaLink" placeholder="<spring:message code="field.Link" />">
							</div>
						</div>
						
					</div>

					<div class="row" style="margin-left: 28%;">
						<div class="col-sm-7" style="width:512px; margin-right: 1%;">
							<div class="row form-group">
								<label for="inputAppImage"><spring:message code="field.Image" /></label>
								<input id="vaImage" name="vaImage" class="file" type="file" multiple=true>
								<input type="hidden" id="vaImageUrl" name="vaImageUrl" >
								<form:errors path="vaImageUrl" cssClass="error" />
							</div>
						</div>
						<div class="col-sm-2" id="updatePicture" style="margin-top: 4%; " id="updatePicture">
							<div class="form-group">
								<label class="label-checkbox">
										<input type="checkbox" onclick="uploadImage()" id="uploadImg" name="uploadImg" >
										<span class="custom-checkbox info"></span>
										<spring:message code="chk.editImg" />
										
								</label>
							</div>
						</div>
					</div>
					
					<div class="row" style="margin-left: 43%;">
						<div class="col-sm-3">	
							<div class="row form-group">
								<input type="hidden" id="uploadImgTemp" name="uploadImgTemp" value="no">
								<input type="hidden" id="processType" name="processType" value="insert" >	
								<button type="submit" class="btn btn-success btn-sm"><i class="fa fa-save"></i>&nbsp;<spring:message code="btn.save" /></button>
								<button type="reset" class="btn btn-default btn-sm"  onclick="clears()"><i class='fa fa-refresh'></i>&nbsp;<spring:message code="btn.clear" /></button>
							</div>
						</div>
					</div>
				</form:form>
				
					<table align="center" style="width: 95%;">
						<tr>
							<td>
							
							
							<table id="applicationdata" class="table table-striped">
								<thead>
									<tr>
										<th><spring:message
										code="field.No" /></th>
										<th><spring:message
										code="field.Id" /></th>
										<th><spring:message
										code="field.AppName" /></th>
										<th><spring:message
										code="field.Image" /></th>
										<th><spring:message
										code="field.Link" /></th>
										<th><spring:message
										code="field.Status" /></th>
										<th><spring:message
										code="field.Manage" /></th>
									</tr>
								</thead>
								
							</table>
							</td>
						</tr>
					</table>
		</div>
	</tiles:putAttribute>
</tiles:insertDefinition>